<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>tk_messageBox manual page - Tk Built-In Commands</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">Tk Commands</a> <small>&gt;</small> messageBox</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<DL>
<DD><A HREF="messageBox.htm#M2" NAME="L1065">NAME</A>
<DL><DD>tk_messageBox &mdash; pops up a message window and waits for user response.</DD></DL>
<DD><A HREF="messageBox.htm#M3" NAME="L1066">SYNOPSIS</A>
<DL>
</DL>
<DD><A HREF="messageBox.htm#M4" NAME="L1067">DESCRIPTION</A>
<DL class="description">
<DD><A HREF="messageBox.htm#M5" NAME="L1068"><B>-command</B> <I>string</I></A>
<DD><A HREF="messageBox.htm#M6" NAME="L1069"><B>-default</B> <I>name</I></A>
<DD><A HREF="messageBox.htm#M7" NAME="L1070"><B>-detail</B> <I>string</I></A>
<DD><A HREF="messageBox.htm#M8" NAME="L1071"><B>-icon</B> <I>iconImage</I></A>
<DD><A HREF="messageBox.htm#M9" NAME="L1072"><B>-message</B> <I>string</I></A>
<DD><A HREF="messageBox.htm#M10" NAME="L1073"><B>-parent</B> <I>window</I></A>
<DD><A HREF="messageBox.htm#M11" NAME="L1074"><B>-title</B> <I>titleString</I></A>
<DD><A HREF="messageBox.htm#M12" NAME="L1075"><B>-type</B> <I>predefinedType</I></A>
<DL class="description">
<DD><A HREF="messageBox.htm#M13" NAME="L1076"><B>abortretryignore</B></A>
<DD><A HREF="messageBox.htm#M14" NAME="L1077"><B>ok</B></A>
<DD><A HREF="messageBox.htm#M15" NAME="L1078"><B>okcancel</B></A>
<DD><A HREF="messageBox.htm#M16" NAME="L1079"><B>retrycancel</B></A>
<DD><A HREF="messageBox.htm#M17" NAME="L1080"><B>yesno</B></A>
<DD><A HREF="messageBox.htm#M18" NAME="L1081"><B>yesnocancel</B></A>
</DL>
</DL>
<DD><A HREF="messageBox.htm#M19" NAME="L1082">EXAMPLE</A>
<DD><A HREF="messageBox.htm#M20" NAME="L1083">KEYWORDS</A>
</DL>
<H3><A NAME="M2">NAME</A></H3>
tk_messageBox &mdash; pops up a message window and waits for user response.
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>tk_messageBox </B>?<I>option value ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
This procedure creates and displays a message window with an
application-specified message, an icon and a set of buttons.  Each of
the buttons in the message window is identified by a unique symbolic
name (see the <B>-type</B> options).  After the message window is
popped up, <B>tk_messageBox</B> waits for the user to select one of the
buttons. Then it returns the symbolic name of the selected button.
<P>
The following option-value pairs are supported:
<P>
<DL class="description">
<DT><A NAME="M5"><B>-command</B> <I>string</I></A><DD>
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog. The actual command consists of <I>string</I> followed by a space
and the name of the button clicked by the user to close the dialog. This
is only available on Mac OS X.
<P><DT><A NAME="M6"><B>-default</B> <I>name</I></A><DD>
<I>Name</I> gives the symbolic name of the default button for
this message window (
&ldquo;ok&rdquo;,
&ldquo;cancel&rdquo;,
and so on). See <B>-type</B>
for a list of the symbolic names.  If this option is not specified,
the first button in the dialog will be made the default.
<P><DT><A NAME="M7"><B>-detail</B> <I>string</I></A><DD>
Specifies an auxiliary message to the main message given by the
<B>-message</B> option. The message detail will be presented beneath the main
message and, where supported by the OS, in a less emphasized font than the
main message.
<P><DT><A NAME="M8"><B>-icon</B> <I>iconImage</I></A><DD>
Specifies an icon to display. <I>IconImage</I> must be one of the
following: <B>error</B>, <B>info</B>, <B>question</B> or
<B>warning</B>. If this option is not specified, then the info icon will be
displayed.
<P><DT><A NAME="M9"><B>-message</B> <I>string</I></A><DD>
Specifies the message to display in this message box. The
default value is an empty string.
<P><DT><A NAME="M10"><B>-parent</B> <I>window</I></A><DD>
Makes <I>window</I> the logical parent of the message box. The message
box is displayed on top of its parent window.
<P><DT><A NAME="M11"><B>-title</B> <I>titleString</I></A><DD>
Specifies a string to display as the title of the message box. This option
is ignored on Mac OS X, where platform guidelines forbid the use of a title
on this kind of dialog.
<P><DT><A NAME="M12"><B>-type</B> <I>predefinedType</I></A><DD>
Arranges for a predefined set of buttons to be displayed. The
following values are possible for <I>predefinedType</I>:
<P>
<DL class="description">
<DT><A NAME="M13"><B>abortretryignore</B></A><DD>
Displays three buttons whose symbolic names are <B>abort</B>,
<B>retry</B> and <B>ignore</B>.
<P><DT><A NAME="M14"><B>ok</B></A><DD>
Displays one button whose symbolic name is <B>ok</B>.
<P><DT><A NAME="M15"><B>okcancel</B></A><DD>
Displays two buttons whose symbolic names are <B>ok</B> and <B>cancel</B>.
<P><DT><A NAME="M16"><B>retrycancel</B></A><DD>
Displays two buttons whose symbolic names are <B>retry</B> and <B>cancel</B>.
<P><DT><A NAME="M17"><B>yesno</B></A><DD>
Displays two buttons whose symbolic names are <B>yes</B> and <B>no</B>.
<P><DT><A NAME="M18"><B>yesnocancel</B></A><DD>
Displays three buttons whose symbolic names are <B>yes</B>, <B>no</B>
and <B>cancel</B>.
<P></DL>
<P></DL>
<P>
<H3><A NAME="M19">EXAMPLE</A></H3>
<PRE>set answer [<B>tk_messageBox</B> -message &quot;Really quit?&quot; &#92;
        -icon question -type yesno &#92;
        -detail &quot;Select &#92;&quot;Yes&#92;&quot; to make the application exit&quot;]
switch -- $answer {
    yes exit
    no {<B>tk_messageBox</B> -message &quot;I know you like this application!&quot; &#92;
            -type ok}
}</PRE>
<H3><A NAME="M20">KEYWORDS</A></H3>
<A href="../Keywords/M.htm#message box">message box</A>
<div class="copy">Copyright &copy; 1996 Sun Microsystems, Inc.
</div>
</BODY></HTML>
